<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>广告管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").attr("action","${ctx}/sys/advertise/advertiseList");
			$("#searchForm").submit();
	    	return false;
	    }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sys/advertise/">广告列表</a></li>
		<shiro:hasPermission name="sys:advertise:edit"><li><a href="${ctx}/sys/advertise/form?sort=10">广告添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="tbAdvertise" action="${ctx}/sys/advertise/advertiseList" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<label>广告名称：</label><form:input path="title" htmlEscape="false" maxlength="50" class="input-medium"/>
		&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
	</form:form>
	<sys:message content="${message}"/>
	<span><font style="color: #00A6C7">${message1}</font></span>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead><tr><th>广告名称</th><th>链接地址</th></th><th>描述</th><th>是否展示</th><th>排序</th><shiro:hasPermission name="sys:advertise:edit"><th>操作</th></shiro:hasPermission></tr></thead>
		<tbody>
		<c:forEach items="${page.list}" var="advertise">
			<tr>
				<td>${advertise.title}</td>
				<%--<td>${advertise.adImageUrl}</td>--%>
				<td>${advertise.adUrl}</td>
				<td>${advertise.adDesc}</td>
				<td><c:if test="${advertise.isActive==1}">是</c:if><c:if test="${advertise.isActive==0}">否</c:if></td>
				<td>${advertise.adSort}</td>
				<shiro:hasPermission name="sys:advertise:edit"><td>
    				<a href="${ctx}/sys/advertise/form?id=${advertise.id}">修改</a>
					<a href="${ctx}/sys/advertise/delete?id=${advertise.id}" onclick="return confirmx('确认要删除该广告吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>